<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
    <style>
      .child {
        display: none;
      }
    </style>
  </head>
  <body>
    <div class="parent">
      父元素
      <div class="child">子元素</div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script>
      $(function () {
        $('.parent').hover(
          // 鼠标移入
          function () {
            $('.child').show()
          },
          // 鼠标移出
          function () {
            $('.child').hide()
          }
        )
      })
    </script>
  </body>
</html>
